﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Personal.Master" Inherits="System.Web.Mvc.ViewPage<PagedList<zeus.Core.Ubicacion>>" %>

<%@ Import Namespace="zeus.Web.Controllers" %>
<%@ Import Namespace="Webdiyer.WebControls.Mvc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">

    <table width="99%" height="429px" border="0" cellpadding="2" cellspacing="2">
        <tr>
            <td>
                <div id="map_canvas" style="width: 100%; height: 422px">
                </div>
            </td>
        </tr>
    </table>

   
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    <script type="text/javascript">

                var latitud1;
                var longitud1;

                function metodo(fecha, b, latitud, longitud) {
                   
                    var cliente;
                    var evento;

                    cliente = "Cueva Willian";
                    evento = "Emergencia";

                    // $("#lbl_cliente").text(b);
                    $("#lbl_cliente").val(cliente);
                    $("#lbl_evento").val(evento);
                    $("#lbl_fecha").val(fecha);
                    $("#lbl_latitud").val(latitud);
                    $("#lbl_longitud").val(longitud);


                    latitud1 = latitud;
                    longitud1 = longitud;

                   

                    if (GBrowserIsCompatible()) {
                        var map = new GMap2(document.getElementById("map_canvas"));
                        map.setMapType(G_HYBRID_MAP);
                        var baseIcon = new GIcon();
                        baseIcon.iconSize = new GSize(32, 32);
                        baseIcon.shadowSize = new GSize(56, 32);
                        baseIcon.iconAnchor = new GPoint(16, 32);
                        baseIcon.infoWindowAnchor = new GPoint(16, 0);
                        var edificio = new GIcon(baseIcon, "http://maps.google.com/mapfiles/kml/pal2/icon14.png", null, "http://maps.google.com/mapfiles/kml/pal2/icon14s.png");
                        var center = new GLatLng(latitud, longitud);
                        map.setCenter(center, 18);
                        var marker = new GMarker(center, edificio);
                        map.setUIToDefault();
                        map.enableRotation();
                        //var ovcontrol = new GOverviewMapControl(new GSize(200, 200));
                        //map.addControl(ovcontrol);
                        GEvent.addListener(marker, "click", function () {
                            marker.openInfoWindowHtml("<b style='color: #0000FF'>Ultima Ubicacion</b><br/><br/><i>Fecha / Hora: " + fecha + "</i><br/><i>Cliente: " + cliente + "</i><br/><i>Evento: " + evento + "</i> ");
                        });
                        //marker.openInfoWindowHtml("<b style='color: #0000FF'>Startel Systems</b><br/><i>Pasaje Génova N24-531 y Rubio de Arévalo</i><br/><i>Telf: (+593) 2232189</i><br/><a href='http://www.startelsystems.com.ec'>Visitanos en nuestra Web!</a> ");
                        map.addOverlay(marker);
                    }

                }

            
               

                function initialize() {
                    
                    if (GBrowserIsCompatible()) {
                        var map = new GMap2(document.getElementById("map_canvas"));
                        map.setMapType(G_HYBRID_MAP);
                        var baseIcon = new GIcon();
                        baseIcon.iconSize = new GSize(32, 32);
                        baseIcon.shadowSize = new GSize(56, 32);
                        baseIcon.iconAnchor = new GPoint(16, 32);
                        baseIcon.infoWindowAnchor = new GPoint(16, 0);
                        var edificio = new GIcon(baseIcon, "http://maps.google.com/mapfiles/kml/pal3/icon21.png", null, "http://maps.google.com/mapfiles/kml/pal3/icon21s.png");
                        var center = new GLatLng(-0.206212, -78.481501);
                        map.setCenter(center, 18);
                        var marker = new GMarker(center, edificio);
                        map.setUIToDefault();
                        map.enableRotation();
                        var ovcontrol = new GOverviewMapControl(new GSize(200, 200));
                        map.addControl(ovcontrol);
                        GEvent.addListener(marker, "click", function () {
                            marker.openInfoWindowHtml("<b style='color: #0000FF'>Startel Systems</b><br/><i>Pasaje Génova N24-531 y Rubio de Arévalo</i><br/><i>Telf: (+593) 2232189</i><br/><a href='http://www.startelsystems.com.ec'>Visitanos en nuestra Web!</a> ");
                        });
                        marker.openInfoWindowHtml("<b style='color: #0000FF'>Startel Systems</b><br/><i>Pasaje Génova N24-531 y Rubio de Arévalo</i><br/><i>Telf: (+593) 2232189</i><br/><a href='http://www.startelsystems.com.ec'>Visitanos en nuestra Web!</a> ");
                        map.addOverlay(marker);
                    }   
                }

        $(window).load(function () {

            initialize();
            


        });

                $(window).unload(function () {
                    GUnload();
                });
    </script>
    
</asp:Content>

